/********************************************************
    Copyright (C), 2020-2099,SZ-STREAMING Tech. Co., Ltd.
    File name: V2xMessageEncode.h
    Author: xuzhibin 
    Date: 2020-06-12
    Description: V2X消息帧编码
********************************************************/

#ifndef __V2XMESSAGEENCODE_H__
#define __V2XMESSAGEENCODE_H__

#include <stdio.h>
#include <sys/types.h>
#include "V2xLog.h"
#include "MessageFrame.h"

typedef struct {
    uint8_t* buffer;
    uint32_t maxSize;   /* buffer最大长度 */
    uint32_t realSize;  /* 编码后实际buffer长度 */
}V2xMsgEncodeBuf_t;

int RM_SDK_V2X_MsgFrameEncode(MessageFrame_t *msgFrame, V2xMsgEncodeBuf_t* msgBuf);
int RM_SDK_V2X_BsmEncode(BSM_t *bsm, V2xMsgEncodeBuf_t* msgBuf);
int RM_SDK_V2X_MapEncode(MAP_t *map, V2xMsgEncodeBuf_t* msgBuf);
int RM_SDK_V2X_RsmEncode(RSM_t *rsm, V2xMsgEncodeBuf_t* msgBuf);
int RM_SDK_V2X_SpatEncode(SPAT_t *spat, V2xMsgEncodeBuf_t* msgBuf);
int RM_SDK_V2X_RsiEncode(RSI_t *rsi, V2xMsgEncodeBuf_t* msgBuf);

#endif


